Ext.namespace('VAS');
/**
 * 审核步骤弹出窗口
 * @param {} config
 */
VAS.AuditSelectWindow = function(config) {
	var _this = this;
	this.config = config;
	VAS.AuditSelectWindow.superclass.constructor.call(this, config);
};

Ext.extend(VAS.AuditSelectWindow, VAS.BasicWindow, {
	id:"auditSelectWindow",
    initComponent : function() {
    	var _this=this;
//    	var query = new VAS.AuditSelectFormWindow({
//    		x : 0,
//			y : 0,
//			title : "审核人员查询",
//			width:660,
//			height:90
//    	});
//    	
//		var gridWindow = new VAS.AuditSelectGridWindow({
//			x : 0,
//			y : 90,
//			title: '审核人员选择列表>>>',
//			width:660,
//			height:293,
//			record:_this.record
//		});
		
    	var query = new VAS.AuditSelectForm({
 
			title : "审核人员查询",
			width:660,
			height:80
    	});
    	
		var grid = new VAS.AuditSelectGrid({

			title: '审核人员列表',
			width:660,
			height:293,
 			gridUrl : "admin/audit/auditStep!listEvent.action",
			storeUrl : "admin/audit/auditStep!listUser.action",
			rowNumberer : true,
			checkboxSelModel : true	,
			record:_this.record
		});    	
    	
    	var config = {
    		closable : true,
    		draggable : true,
			width : 675,
			height : 447,
			frame : true,
			layout : "form",
			items : [query, grid],
			buttons : [{
						text : '确定',
						handler : function() {
							var selected = Ext.getCmp("AuditSelectGrid").getSelectionModel().getSelected();
							if(selected == undefined) {
								Ext.Msg.alert('提示','请选择');
								return false;
							}
							var userId = selected.data.id;
							var userName = selected.data.userName;
							_this.record.set('userName',userName);
							_this.record.set('userId',userId);
							_this.close();
						}
					},{
						text : "关闭",
						handler : function() {
							_this.close();
						}
					}]
		};
		var _config = config || {};	
		Ext.apply(this, _config);
		Ext.apply(this.initialConfig, _config);
		VAS.AuditSelectWindow.superclass.initComponent.apply(this, arguments);
    }
});
Ext.reg('auditSelect-win',VAS.AuditSelectWindow);
